/**
 * 专业培养计划接口
 */
import request from '@/utils/request'
const baseApi = '/course/major-plan'

export function getMajorPlanDetail(reqData) {
  return request({
    url: `${baseApi}/detail`,
    method: 'post',
    data: reqData
  })
}

export function createMajorPlan(majorId) {
  return request({
    url: `${baseApi}/create`,
    method: 'post',
    params: { majorId }
  })
}

export function updateMajorPlanBasic(reqData) {
  return request({
    url: `${baseApi}/update`,
    method: 'post',
    data: reqData
  })
}

export function addRequireCourse(reqData) {
  return request({
    url: `${baseApi}/addRequireCourse`,
    method: 'post',
    data: reqData
  })
}

export function addOptionalCourse(reqData) {
  return request({
    url: `${baseApi}/addOptionalCourse`,
    method: 'post',
    data: reqData
  })
}

export function deleteRequireCourse(ids) {
  return request({
    url: `${baseApi}/deleteRequireCourse`,
    method: 'post',
    data: ids
  })
}

export function deleteOptionalCourse(ids) {
  return request({
    url: `${baseApi}/deleteOptionalCourse`,
    method: 'post',
    data: ids
  })
}

export function listMajorRequireCourse(majorId) {
  return request({
    url: `${baseApi}/list/requireCourse`,
    method: 'get',
    params: { majorId }
  })
}
